package com.lsa.letcode.the1.twosum;

import java.util.Arrays;

import org.junit.Assert;

import junit.framework.TestCase;

public class TwoSumTest extends TestCase {
	public void testTwoSum() {
		test(new int[]{2,7,11,15},9, new int[]{1,2});
		test(new int[]{3,2,4},6, new int[]{2,3});
		test(new int[]{0,4,3,0},0, new int[]{1,4});
		test(new int[]{5,75,25},100, new int[]{2,3});
	}
	
	private void test(int[] input, int target, int[] expected) {
		Solution s = new Solution();
		int[] actual = s.twoSum(input,target);
		Assert.assertTrue(Arrays.toString(actual), Arrays.equals(expected, actual));
	}
}
